package beans;


import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import EventPackage.Event;

public class TempSimulaorBean {
	
	//EventManager EventManager = new EventManager();
	BodyTemperatureSensor bodyTemperatureSensor;// = new BodyTemperatureSensor();
	TemperatureMonitor temperatureMonitor = new TemperatureMonitor();
	EventMonitor2 eventMonitor2 = new EventMonitor2();
	
	public TempSimulaorBean() {
		super();
		bodyTemperatureSensor = new BodyTemperatureSensor();
		bodyTemperatureSensor.start();
		temperatureMonitor.start();
		eventMonitor2.start();
	}

	public List<String> generateTemp2(){
    	List<String> results2 = new ArrayList<String>();
    	results2 =temperatureMonitor.getEventList();
    	return results2;
		
	}

	public void removeComponents(){
		ComponentMonitor componentMonitor = new ComponentMonitor();
		componentMonitor.start();
		
	}
	
	public List<Event> getCurrentEvents(){
    	List<Event> results2 = new ArrayList<Event>();
    	results2 =eventMonitor2.getEventList();
    	return results2;
		
	}
	
	public String sendBPMReading(){
		String bpm="";
    	double result = GetRandomNumber();
    	bpm =Double.toString(result);
		return bpm;
	}
	   public List<String> generateTemp(){
	    	List<String> results = new ArrayList<String>();
	    	double result = GetRandomNumber();
	    	for(int i=0; i<10; i++){
	    		 result = GetRandomNumber();
	    		 results.add(Double.toString(result));
	    	//	System.out.print("result" +result);
	    	}
	    	return results;
	    }
	    public double GetRandomNumber()
		{
			Random r = new Random();
			int intVal =r.nextInt(150);
			return (double)intVal;
		} // GetRandomNumber

}
